/*
GPNestedNavigationDelegate.h
Date Created: February 19, 2010

Author: Karol Krizka <kkrizka@gmail.com>

Copyright (C) 2010 Green-Power

URL: http://code.google.com/p/green-power

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

$Id$
*/

#import <Foundation/Foundation.h>

/**
 * Delegate that makes it easy to embed navigation controllers inside tab bar
 * controllers, when the tab bars are themselves embeded inside a different 
 * navigation controller. This is useful, because it allow each tab to contain
 * its own navigation controller independetly of the overall controller.
 *
 * By default, two navigations bars will be displayed; one for the top navgiation
 * controller and one for the tab's navigation controller. This delegate makes
 * sure that only one is visible at a time.
 * 
 * It makes sure that:
 * <ul>
 *  <li>The top navigation bar is visible when the tab navigation bar contains
 *      only the root controller. This way, a back button that navigates to the 
 *      view controller below the tab controller is visible.</li>
 *  <li>The tob navigation bar is replaced by the tab navigation bar when a tab
 *      pushes a new controller on top of its nested navigation stack.</li>
 *  <li>Switching the tabs displays the correct navigation bar.</li>
 *  <li>Switching the tabs displays the correct title in the top navigation bar</li>
 * </ul>
 *
 * To use this delegate, all tab navigation controllers must connect to this
 * delegate. Also the tab controller must connect to this delegate. Finally, 
 * the top navigation controller must be connected to the delegate's 
 * |topNavigationController| outlet.
 *
 * As of now, there are still a few shortfalls that need to be worked out.
 * <ul>
 *  <li>The transition between the top navigation bar and the tab navigation bar
 *      is choppy.</li>
 *  <li>One must manually set the top navigation bar's title when the tab 
 *      controller is pushed on it. GPNestedNavigationDelegate only updates
 *      the title on tab switches.</li>
 *  <li>The delegate assumes that a navigation bar should always be visible</li>
 * </ul>
 */
@interface GPNestedNavigationDelegate : NSObject<UITabBarControllerDelegate, UINavigationControllerDelegate> {
  UINavigationController *topNavigationController;
}

@property (nonatomic,retain) IBOutlet UINavigationController *topNavigationController;

@end
